package com.yang.action.Html;

import com.yang.service.CategoryService;
import com.yang.util.RespEntity;
import com.yang.util.RespUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/HtmldeleteById")
public class HtmlProCateoryByIdAction extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        String pid = req.getParameter("pid");
        System.out.println(id);
        System.out.println("怕人那天：::::"+pid);
        CategoryService categoryService = new CategoryService();
        RespEntity respEntity = categoryService.deleteCategory(Integer.parseInt(id), Integer.parseInt(pid));
        RespUtil.sendJSON(resp, respEntity);

    }
}
